package com.example.uploadhealth.controller;

import com.example.uploadhealth.domain.ResponseResult;
import com.example.uploadhealth.service.HealthImgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
public class HealthController {
    @Autowired
    private HealthImgService healthImgService;
    @PostMapping("/upload")
    public ResponseResult upLoadHealth(MultipartFile img){
        return healthImgService.upLoadHealth(img);
    }
    @GetMapping("/getUserHealthImg")
    public ResponseResult getUserHealthImg(Integer pageNum, Integer pageSize){
        System.out.println("sss");
        return healthImgService.getUserHealthImg(pageNum,pageSize);
    }
    //查找指定姓名的健康码信息
    @GetMapping("/getUserHealthByNickName")
    public ResponseResult getUserHealthByNickName(String nickName){
        return healthImgService.getUserHealthByNickName(nickName);
    }
    @GetMapping("/getUserTravelImg")
    public ResponseResult getUserTravelImg(Integer pageNum, Integer pageSize){
        System.out.println("ttt");
        return healthImgService.getUserTravelImg(pageNum,pageSize);
    }
}
